/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2023-03-28
 * Time:18:06
 */

/**
 * JZ3数组中重复的数字
 */
import java.util.*;

public class duplicate {
    public static void main(String[] args) {
        int nums[] = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 6; i++) {
            nums[i] = scanner.nextInt();
        }
        System.out.println(duplicate(nums));
    }
    public static int duplicate(int[] numbers) {
        // write code here
        if (numbers.length == 0 || numbers == null){
            return 0;
        }
       int output = 0;
       int size1 = 0;
       int size = 0;
        for (int i = 0; i < numbers.length; i++) {
            for (int j = i; j < numbers.length; j++) {
                if (numbers[j] == numbers[i]){
                    size1++;
                }
                if (size1 > size){
                    size = size1;
                    output = numbers[i];
                }
            }
            size1 = 0;
        }
        return output;
    }
}
